import pandas as pd
import json

def load_json_data(filename: str) -> pd.DataFrame:
    """加载data目录下的JSON数据"""
    try:
        with open(f"E:\课程\数据可视化\src\data\{filename}", 'r', encoding='utf-8') as f:
            data = json.load(f)
        return pd.DataFrame(data)
    except Exception as e:
        print(f"加载数据失败: {e}")
        return pd.DataFrame()